<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->get('/index', 'HomeController@index');

    $router->get('phpinfo',function (){
        phpinfo();
    });

    $router->resources([

        'posts'                 => PostController::class,

        'goods/examine'         => Goods\ExamineController::class,
        'goods/recycle'         => Goods\RecycleController::class,
        'goods'                 => Goods\GoodsController::class,
        'users'                 => User\UserController::class,
        'member/price'          => Member\PriceController::class,
        'kf/teacher'            => Kefu\TeacherController::class,
        'kf/parent'             => Kefu\ParentController::class,
        'kf/user'               => Kefu\UserController::class,
        'sys/child'             => Sys\ChildController::class,
        'subscribe/status'      => Subscribe\StatusListController::class,
        'subscribe/info'        => Subscribe\InfoListController::class,
        'subscribe/expire'      => Subscribe\ExpireController::class,
        'sys/tasks'             => Sys\TaskController::class,
        'sys/rules'             => Sys\RuleController::class,
        'sys/price'             => Sys\PriceController::class,
        'sys/configs'           => Sys\ConfigController::class,
        'sys/school'            => Sys\SchoolController::class,
        'student'               => School\StudentController::class,

        'audit/school'          => Audit\SchoolController::class,

        'statistics/trade'      => Statistics\TradeController::class,
        'statistics/register'   => Statistics\RegisterController::class,
        'statistics/community'  => Statistics\CommunityController::class,//班务管理
        'statistics/nearby'     => Statistics\NearbyController::class,//附近管理
        'honor'                 => School\HonorController::class,//光荣榜管理
        'exams'                 => School\ExamController::class,//成绩管理
        'works'                 => WorkController::class,//作业管理
        'assignment/confirm'    => Task\Assignment\ConfirmController::class,//作业龙虎榜

        'exchange'              => Order\ExchangeController::class,
        'deliver'               => Order\DeliverController::class,
        'ads/category'          => Sys\AdsCategoryController::class,//广告位管理
        'ads'                   => Sys\AdsController::class,//广告列表
        'behaviors'             => Sys\BehaviorController::class,//系统行为管理

        'messages'              => Admin\PinionController::class,//客户留言


        'wechat/response'       => Wechat\ResponseController::class,
        'school/intention'      => School\IntentionController::class,
        'plate_version'         => Plate\VersionController::class,
        'order/subscribe'       => Order\SubscribeController::class,
        'order/vip'             => Order\VipController::class,



    ]);

    $router->get('api/city/city',User\ApiController::class.'@city');
    $router->get('api/city/area',User\ApiController::class.'@area');

    $router->post('goods/recycle/{id}', Goods\RecycleController::class.'@restore');
    $router->get('users/parentDetail/{id}',User\UserController::class.'@parentDetail');
    $router->post('users/delChild',User\UserController::class.'@delChild');
    $router->post('users/updateChild',User\UserController::class.'@updateChild');
    $router->post('users/editUser',User\UserController::class.'@editUser');
    $router->get('user/account',User\AccountController::class.'@index');
    $router->get('user/account/money/{id}',User\AccountController::class.'@money');
    $router->get('user/account/expe/{id}',User\AccountController::class.'@expe');
    $router->any('account/updateAccount',User\AccountController::class.'@updateAccount');
    $router->get('api/memberPrice','Member\ApiController@memberPrice');

    $router->post('sys/rules/updatePro',Sys\RuleController::class.'@updatePro');

    $router->get('api/getTransactionData',Statistics\TradeController::class.'@getTransactionData');
    $router->get('api/getSalesVolume',Statistics\TradeController::class.'@getSalesVolume');
    $router->get('api/getCustomerData',Statistics\TradeController::class.'@getCustomerData');
    //统计-获取会员增长情况
    $router->get('api/getUserRegister',Statistics\RegisterController::class.'@getUserRegister');
    //评论
    $router->post('community/addComment',Statistics\CommunityController::class.'@addComment');
    $router->get('community/getComment',Statistics\CommunityController::class.'@getComment');

    //关闭订单
    $router->post('closeOrder',Order\InfoController::class.'@closeOrder');

    //获取光荣榜数据
    $router->post('honor/getHonorData',School\HonorController::class.'@getHonorData');

    //作业评论
    $router->post('work/addComment',WorkController::class.'@addComment');
    $router->get('work/getComment',WorkController::class.'@getComment');

    //批量发货
    $router->post('order/batchDeliver',Order\DeliverController::class.'@batchDeliver');

    //首页统计 获取订单统计数据
    $router->get('api/getOrderData',HomeController::class.'@getOrderData');
    //首页统计 获取交易统计数据
    $router->get('api/getExchangeData',HomeController::class.'@getExchangeData');

    //微信公众号
    $router->get('wechat/menu',Wechat\MenuController::class.'@index');
    $router->post('wechat/menu/edit',Wechat\MenuController::class.'@edit');
    $router->post('wechat/menu/sync',Wechat\MenuController::class.'@sync');
    $router->post('wechat/response/select',Wechat\ResponseController::class.'@select');




    $router->any('uploads/uploadImages', 'HomeController@uploadImages');


    $router->group(['prefix' => 'editors'], function ($router) {
        $router->get('markdown', EditorsController::class.'@markdown');
        $router->get('wang-editor', EditorsController::class.'@wangEditor');
        $router->get('summernote', EditorsController::class.'@summernote');
        $router->get('json', EditorsController::class.'@json');
    });

    $router->group(['prefix' => 'code-mirror'], function ($router) {
        $router->get('clike', CodemirrorController::class.'@clike');
        $router->get('php', CodemirrorController::class.'@php');
        $router->get('js', CodemirrorController::class.'@js');
        $router->get('python', CodemirrorController::class.'@python');
    });

    $router->group(['prefix' => 'lightbox'], function ($router) {
        $router->get('lightbox', LightboxController::class.'@lightbox');
        $router->get('gallery', LightboxController::class.'@gallery');
    });

    $router->get('chartjs', 'ChartjsController@index');


});
